﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Banners.aspx.cs" Inherits="Manager_Banners" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>广告与焦点图管理</title>
</head>
<body>
    <form id="form1" runat="server">
        <ext:PageManager ID="PageManager1" runat="server" AjaxLoadingType="mask" AutoSizePanelID="RegionPanel1" />
        <ext:RegionPanel ID="RegionPanel1" runat="server" ShowBorder="false">
            <Regions>
                <ext:Region ID="rLeft" runat="server" Position="Center" AutoScroll="true" ShowHeader="false"
                    ShowBorder="false" Layout="fit" EnableBackgroundColor="true">
                    <Items>
                        <ext:Grid ID="gridList" runat="server" AllowPaging="true" PageSize="25" ForceFitAllTime="true"
                            EmptyText="暂时没有相关数据!" DataKeyNames="BannerID" ShowBorder="false" EnableRowNumber="true"
                            IsDatabasePaging="true" EnableRowNumberPaging="true" AutoScroll="true" Title="广告与焦点图列表"
                            EnableCheckBoxSelect="true" OnPageIndexChange="gridList_PageIndexChange" OnRowDoubleClick="gridList_RowDoubleClick"
                            ShowHeader="false" EnableRowDoubleClick="true">
                            <Toolbars>
                                <ext:Toolbar ID="Toolbar2" runat="server">
                                    <Items>
                                        <ext:ToolbarText ID="ToolbarText1" runat="server" Text="广告与焦点图列表">
                                        </ext:ToolbarText>
                                        <ext:ToolbarFill ID="ToolbarFill1" runat="server">
                                        </ext:ToolbarFill>
                                        <ext:ToolbarText ID="ToolbarText2" runat="server" Text="（双击编辑广告与焦点图，若要新增则点击“重置”即可！）"
                                            CssStyle="color:red">
                                        </ext:ToolbarText>
                                        <ext:Button ID="btnSelectDelete" runat="server" Text="删除选中" Icon="delete" OnClick="btnSelectDelete_Click"
                                            ConfirmText="是否确定删除？">
                                        </ext:Button>
                                    </Items>
                                </ext:Toolbar>
                            </Toolbars>
                            <Columns>
                            
                <ext:TemplateField ID="tfExpander" runat="server" RenderAsRowExpander="true">
                    <ItemTemplate>
                        <div class="expander"><img src="<%# Eval("BannerUrl") %>" alt="<%# Eval("BannerName") %>" title="<%# Eval("BannerName") %>" />
                        </div>
                    </ItemTemplate>
                </ext:TemplateField>
                                <ext:BoundField ID="bfTitle" ColumnID="bfTitle" runat="server" DataField="BannerName"
                                    HeaderText="广告名称" />
                                <ext:TemplateField runat="server" HeaderText="广告位置">
                                    <ItemTemplate>
                                        <%# GetIsWhere(Eval("IsWhere")) %>
                                    </ItemTemplate>
                                </ext:TemplateField>
                                <ext:BoundField ID="bfUrl" ColumnID="bfUrl" runat="server" DataField="LinkUrl" HeaderText="广告链接" />
                                <ext:BoundField ID="bfOrderNum" ColumnID="bfOrderNum" runat="server" DataField="OrderNum"
                                    HeaderText="排序" />
                                <ext:CheckBoxField ID="cboxAStatus" runat="server" HeaderText="状态" DataField="Status"
                                    Width="40" TextAlign="center" />
                                <ext:BoundField ID="bfAddTime" ColumnID="bfAddTime" runat="server" DataField="AddTime"
                                    HeaderText="时间" />
                            </Columns>
                        </ext:Grid>
                    </Items>
                </ext:Region>
                <ext:Region ID="rRight" runat="server" AutoScroll="true" Position="right" ShowHeader="false"
                    Split="true" ShowBorder="false" EnableBackgroundColor="true" Width="360px" Height="200px">
                    <Items>
                        <ext:SimpleForm ID="sfObject" runat="server" BodyPadding="5px" Title="新增（编辑）广告与焦点图"
                            LabelWidth="70px" EnableBackgroundColor="true" AutoScroll="true" LabelAlign="Right"
                            FooterBarAlign="center">
                            <Items>
                                <ext:HiddenField ID="hfBannerId" runat="server">
                                </ext:HiddenField>
                                <ext:DropDownList ID="ddlAdvType" runat="server" Required="true" Label="广告位置">
                                    <ext:ListItem Value="" Text="--请选择--" />
                                    <ext:ListItem Value="1" Text="首页Banner广告(规格：1149*487px)" />
                                    <ext:ListItem Value="2" Text="荣誉证书(规格：154*116px)" />
                                </ext:DropDownList>
                                <ext:TextBox ID="txtTitle" runat="server" Label="图片名称" Required="true" EmptyText="请填写名称">
                                </ext:TextBox>
                                <ext:FileUpload ID="fuAdvImg" runat="server" Label="广告图" EmptyText="请选择相应广告图！">
                                </ext:FileUpload>
                                <ext:TextBox ID="txtUrl" runat="server" Label="URL" EmptyText="请填写网址，必带“http://”！"
                                    Regex="(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&amp;:/~\+#]*[\w\-\@?^=%&amp;/~\+#])?">
                                </ext:TextBox>
                                <ext:TextBox ID="txtOrderNum" runat="server" Regex="^\d+" Label="排序" Text="1">
                                </ext:TextBox>
                                <ext:CheckBox ID="cboxStatus" runat="server" Label="状态" Text="启用/停用">
                                </ext:CheckBox>
                            </Items>
                            <Toolbars>
                                <ext:Toolbar ID="Toolbar1" runat="server" Position="footer">
                                    <Items>
                                        <ext:Button ID="btnSubmit" runat="server" Text="资料保存" Icon="systemsave" ValidateForms="sfObject"
                                            OnClick="btnSubmit_Click">
                                        </ext:Button>
                                        <ext:Button ID="btnReset" runat="server" Text="重 置" Icon="reload">
                                        </ext:Button>
                                    </Items>
                                </ext:Toolbar>
                            </Toolbars>
                        </ext:SimpleForm>
                    </Items>
                </ext:Region>
            </Regions>
        </ext:RegionPanel>
    </form>
</body>
</html>
